#include <gtk/gtk.h>
#include "gtkcontaineraccessible.h"
+#include "gtkcontaineraccessibleprivate.h"
struct _GtkContainerAccessiblePrivate
{
atk_child = gtk_widget_get_accessible (widget);
accessible = GTK_CONTAINER_ACCESSIBLE (atk_parent);
- g_object_notify (G_OBJECT (atk_child), "accessible-parent");
g_list_free (accessible->priv->children);
accessible->priv->children = gtk_container_get_children (container);
index = g_list_index (accessible->priv->children, widget);
- g_signal_emit_by_name (atk_parent, "children-changed::add", index, atk_child, NULL);
+ _gtk_container_accessible_add_child (accessible, atk_child, index);
return 1;
}
return 1;
accessible = GTK_CONTAINER_ACCESSIBLE (atk_parent);
- g_object_notify (G_OBJECT (atk_child), "accessible-parent");
index = g_list_index (accessible->priv->children, widget);
g_list_free (accessible->priv->children);
accessible->priv->children = gtk_container_get_children (container);
- if (index >= 0 && index <= g_list_length (accessible->priv->children))
- g_signal_emit_by_name (atk_parent, "children-changed::remove", index, atk_child, NULL);
+ if (index >= 0)
+ _gtk_container_accessible_remove_child (accessible, atk_child, index);
return 1;
}
{
container->priv = gtk_container_accessible_get_instance_private (container);
}
+
+void
+_gtk_container_accessible_add_child (GtkContainerAccessible *accessible,
+ AtkObject *child,
+ gint index)
+{
+ g_object_notify (G_OBJECT (child), "accessible-parent");
+ g_signal_emit_by_name (accessible, "children-changed::add", index, child, NULL);
+}
+
+void
+_gtk_container_accessible_remove_child (GtkContainerAccessible *accessible,
+ AtkObject *child,
+ gint index)
+{
+ g_object_notify (G_OBJECT (child), "accessible-parent");
+ g_signal_emit_by_name (accessible, "children-changed::remove", index, child, NULL);
+}
--- /dev/null
+/* GTK+ - accessibility implementations
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GTK_CONTAINER_ACCESSIBLE_PRIVATE_H__
+#define __GTK_CONTAINER_ACCESSIBLE_PRIVATE_H__
+
+#include <gtk/a11y/gtkcontaineraccessible.h>
+
+G_BEGIN_DECLS
+
+void _gtk_container_accessible_add_child (GtkContainerAccessible *accessible,
+ AtkObject *child,
+ gint index);
+void _gtk_container_accessible_remove_child (GtkContainerAccessible *accessible,
+ AtkObject *child,
+ gint index);
+G_END_DECLS
+
+#endif /* __GTK_CONTAINER_ACCESSIBLE_PRIVATE_H__ */